<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title>Animation Example - Adding Attributes to an Existing Animation</title>
<link rel="stylesheet" type="text/css" href="css/demo.css">

<script type="text/javascript" src="../../build/yahoo/yahoo.js"></script>
<script type="text/javascript" src="../../build/event/event.js"></script>
<script type="text/javascript" src="../../build/dom/dom.js"></script>
<script type="text/javascript" src="../../build/animation/animation.js"></script>

<script type="text/javascript">
YAHOO.example.init = function() {   
   var attributes = {
      width: {to: 100},
      height: {to: 100}
   };
    
   var anim = new YAHOO.util.Anim('demo', attributes);
   anim.attributes.fontSize = { from: 100, to: 60, unit: '%' };
   anim.attributes.opacity = { to: 0.5 };
   anim.method = YAHOO.util.Easing.elasticOut;
   
   YAHOO.util.Event.on(document, 'click', anim.animate, anim, true);
};

YAHOO.util.Event.onAvailable('demo', YAHOO.example.init);
</script>
</head>
<body id="animation-demo-size-plus">
<div id="doc">
   <h1>Animation Example - Adding Attributes to an Existing Animation</h1>
   <p>This example demonstrates how to animate an element's size to a given value.  Other attributes are added after the instance is created in this example.</p>
   <p>Click anywhere to start animation.</p>
   <div id="demo">Lorem ipsum dolor </div>  
</div>
</body>
</html>
